package kafka

import (
	"github.com/IBM/sarama"
	"go.uber.org/zap"
)

func InitKafkaClient() sarama.Client {
	saramaCfg := sarama.NewConfig()
	saramaCfg.Producer.Return.Successes = true
	client, err := sarama.NewClient([]string{"127.0.0.1:9094"}, saramaCfg)
	if err != nil {
		zap.L().Error("kafka consumer InitKafkaClient:", zap.Error(err))
		return nil
	}
	return client
}
